package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Homework;
import com.es.disped.dao.model.HomeworkExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface HomeworkMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @SelectProvider(type=HomeworkSqlProvider.class, method="countByExample")
    long countByExample(HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @DeleteProvider(type=HomeworkSqlProvider.class, method="deleteByExample")
    int deleteByExample(HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Delete({
        "delete from homework",
        "where homework_id = #{homeworkId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String homeworkId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Insert({
        "insert into homework (homework_id, homework_name, ",
        "lesson_id, lesson_name, ",
        "home_work_url, homework_update_time, ",
        "homework_valid, homework_content)",
        "values (#{homeworkId,jdbcType=CHAR}, #{homeworkName,jdbcType=VARCHAR}, ",
        "#{lessonId,jdbcType=CHAR}, #{lessonName,jdbcType=VARCHAR}, ",
        "#{homeWorkUrl,jdbcType=VARCHAR}, #{homeworkUpdateTime,jdbcType=VARCHAR}, ",
        "#{homeworkValid,jdbcType=INTEGER}, #{homeworkContent,jdbcType=LONGVARCHAR})"
    })
    int insert(Homework record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @InsertProvider(type=HomeworkSqlProvider.class, method="insertSelective")
    int insertSelective(Homework record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @SelectProvider(type=HomeworkSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="homework_id", property="homeworkId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="homework_name", property="homeworkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="home_work_url", property="homeWorkUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_update_time", property="homeworkUpdateTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_valid", property="homeworkValid", jdbcType=JdbcType.INTEGER),
        @Result(column="homework_content", property="homeworkContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Homework> selectByExampleWithBLOBs(HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @SelectProvider(type=HomeworkSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="homework_id", property="homeworkId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="homework_name", property="homeworkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="home_work_url", property="homeWorkUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_update_time", property="homeworkUpdateTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_valid", property="homeworkValid", jdbcType=JdbcType.INTEGER)
    })
    List<Homework> selectByExample(HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Select({
        "select",
        "homework_id, homework_name, lesson_id, lesson_name, home_work_url, homework_update_time, ",
        "homework_valid, homework_content",
        "from homework",
        "where homework_id = #{homeworkId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="homework_id", property="homeworkId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="homework_name", property="homeworkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lesson_id", property="lessonId", jdbcType=JdbcType.CHAR),
        @Result(column="lesson_name", property="lessonName", jdbcType=JdbcType.VARCHAR),
        @Result(column="home_work_url", property="homeWorkUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_update_time", property="homeworkUpdateTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="homework_valid", property="homeworkValid", jdbcType=JdbcType.INTEGER),
        @Result(column="homework_content", property="homeworkContent", jdbcType=JdbcType.LONGVARCHAR)
    })
    Homework selectByPrimaryKey(String homeworkId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Homework record, @Param("example") HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Homework record, @Param("example") HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Homework record, @Param("example") HomeworkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @UpdateProvider(type=HomeworkSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Homework record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Update({
        "update homework",
        "set homework_name = #{homeworkName,jdbcType=VARCHAR},",
          "lesson_id = #{lessonId,jdbcType=CHAR},",
          "lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "home_work_url = #{homeWorkUrl,jdbcType=VARCHAR},",
          "homework_update_time = #{homeworkUpdateTime,jdbcType=VARCHAR},",
          "homework_valid = #{homeworkValid,jdbcType=INTEGER},",
          "homework_content = #{homeworkContent,jdbcType=LONGVARCHAR}",
        "where homework_id = #{homeworkId,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Homework record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table homework
     *
     * @mbg.generated Sun Jul 07 11:47:51 CST 2019
     */
    @Update({
        "update homework",
        "set homework_name = #{homeworkName,jdbcType=VARCHAR},",
          "lesson_id = #{lessonId,jdbcType=CHAR},",
          "lesson_name = #{lessonName,jdbcType=VARCHAR},",
          "home_work_url = #{homeWorkUrl,jdbcType=VARCHAR},",
          "homework_update_time = #{homeworkUpdateTime,jdbcType=VARCHAR},",
          "homework_valid = #{homeworkValid,jdbcType=INTEGER}",
        "where homework_id = #{homeworkId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Homework record);
}